<?php
class District extends CI_Model 
{
	private $db_customer = 'customer.';
	
    function __construct()
    {
        parent::__construct();
    }
	
	function get_all_name()
	{
		$this->db->select('dist_id,dist_name');
		$this->db->from($this->db_customer.'districts');
		$this->db->order_by("dist_id", "asc");
		$query = $this->db->get();
		
		foreach ($query->result() as $row) {
			$data[$row->dist_id] = $row->dist_name;
		}
		return $data;
	}
	
	function get_district_name($dist_id) {
		$this->db->select('dist_name');
		$this->db->from($this->db_customer.'districts');
		$this->db->where('dist_id',$dist_id);
		$query = $this->db->get();
		return $query->row()->dist_name;
	}
}
?>
